package com.wjerp.tplus.server.common.model;


import java.io.Serializable;
import java.util.List;

/**
 * 发票查验信息
 * @author lishuailei
 */
public class InvoiceCheckResponse implements Serializable {

    /**
     * 响应码，200表示查询成功，其余均为查询失败
     */
    private Integer code;

    /**
     * "inArea":"重庆", 发票区域
     */
    private String inArea;

    /**
     * "inDate":"20100417",	开票日期
     */
    private String inDate;

    /**
     * "inTotalAmtCn":"叁万贰仟捌佰肆拾玖圆叁角零分整",开票总金额大写
     */
    private String inTotalAmtCn;

    /**
     * "inCode":"50****2130",发票代码
     */
    private String inCode;

    /**
     * "inTaxAmt":"325.23",总税费
     */
    private String inTaxAmt;

    /**
     * "message":"发票查验成功",	响应信息
     */
    private String message;

    /**
     *  "inTotalAmt":"32849.3",	开票总金额
     */
    private String inTotalAmt;

    /**
     * "inNo":"0*****76",发票号码
     */
    private String inNo;

    /**
     * 校验码
     */
    private String inCheckCode;

    /**
     * 税后金额
     */
    private String inAmt;

    /**
     * 机器编号
     */
    private String inMachineNo;

    /**
     * "inType":"增值税专用发票",	发票类型
     */
    private String inType;

    /**
     * 备注
     */
    private String remarks;

    /**
     * 销售方信息
     *     "salerInfo":{					//销售方信息
     *         "addressPhone":"重庆市**街道131****3456",	//销售方地址、联系电话
     *         "name":"重庆市****有限公司",			//销售方名称
     *         "taxNo":"925**********29",			//销售方税号
     *         "account":"重庆******分理处030*****0007716"	//销售方银行账号、开户行信息
     *     },
     */
    private CompanyInfo salerInfo;

    /**
     * 购买方信息
     *   "buyerInfo":{					//购买方信息
     *         "addressPhone":"重庆市**广场 023-89****20",	//购买方地址、联系电话
     *         "name":"重庆***有限公司",			//购买方名称
     *         "taxNo":"915********0265",			//购买方税号
     *         "account":"中国建设银行**支行营业部50****521"	//购买方银行账号、开户行信息
     *     }
     */
    private CompanyInfo buyerInfo;

    /**
     * 商品明细
     *     "tradeInfos":[					//商品明细
     *         {
     *             "tradeAmt":"1922.28",			//
     *             "unitPrice":"17.475247524752475",		//
     *             "taxRate":"0.01",				//
     *             "number":"110",				//
     *             "tradeName":"*非金属矿物制品*砼预制过梁",	//商品名称
     *             "unit":"根",				//商品单位
     *             "typeNo":"1000*100*60",			//
     *             "taxAmt":"19.22"				//
     *         }
     *     ]
     */
    private List<TradeInfo> tradeInfos;

    public String getSaleCompanyName(){
        return salerInfo == null ? "" : salerInfo.getName();
    }


    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getInArea() {
        return inArea;
    }

    public void setInArea(String inArea) {
        this.inArea = inArea;
    }

    public String getInDate() {
        return inDate;
    }

    public void setInDate(String inDate) {
        this.inDate = inDate;
    }

    public String getInTotalAmtCn() {
        return inTotalAmtCn;
    }

    public void setInTotalAmtCn(String inTotalAmtCn) {
        this.inTotalAmtCn = inTotalAmtCn;
    }

    public String getInCode() {
        return inCode;
    }

    public void setInCode(String inCode) {
        this.inCode = inCode;
    }

    public String getInTaxAmt() {
        return inTaxAmt;
    }

    public void setInTaxAmt(String inTaxAmt) {
        this.inTaxAmt = inTaxAmt;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public String getInTotalAmt() {
        return inTotalAmt;
    }

    public void setInTotalAmt(String inTotalAmt) {
        this.inTotalAmt = inTotalAmt;
    }

    public String getInNo() {
        return inNo;
    }

    public void setInNo(String inNo) {
        this.inNo = inNo;
    }

    public String getInCheckCode() {
        return inCheckCode;
    }

    public void setInCheckCode(String inCheckCode) {
        this.inCheckCode = inCheckCode;
    }

    public String getInAmt() {
        return inAmt;
    }

    public void setInAmt(String inAmt) {
        this.inAmt = inAmt;
    }

    public String getInMachineNo() {
        return inMachineNo;
    }

    public void setInMachineNo(String inMachineNo) {
        this.inMachineNo = inMachineNo;
    }

    public String getInType() {
        return inType;
    }

    public void setInType(String inType) {
        this.inType = inType;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public CompanyInfo getSalerInfo() {
        return salerInfo;
    }

    public void setSalerInfo(CompanyInfo salerInfo) {
        this.salerInfo = salerInfo;
    }

    public CompanyInfo getBuyerInfo() {
        return buyerInfo;
    }

    public void setBuyerInfo(CompanyInfo buyerInfo) {
        this.buyerInfo = buyerInfo;
    }

    public List<TradeInfo> getTradeInfos() {
        return tradeInfos;
    }

    public void setTradeInfos(List<TradeInfo> tradeInfos) {
        this.tradeInfos = tradeInfos;
    }

    public String getBuyerCompanyName(){
        return buyerInfo.name;
    }

    class TradeInfo{
        /**
         * 商品总金额
         */
        private String tradeAmt;

        /**
         * 商品单价
         */
        private String  unitPrice;

        /**
         * 商品税率
         */
        private String taxRate;

        /**
         * 商品数量
         */
        private String number;
        /**
         * 商品名称
         */
        private String tradeName;
        /**
         * 单位
         */
        private String unit;
        /**
         * 商品编号
         */
        private String typeNo;
        /**
         * 商品税费
         */
        private String taxAmt;

        public String getTradeAmt() {
            return tradeAmt;
        }

        public void setTradeAmt(String tradeAmt) {
            this.tradeAmt = tradeAmt;
        }

        public String getUnitPrice() {
            return unitPrice;
        }

        public void setUnitPrice(String unitPrice) {
            this.unitPrice = unitPrice;
        }

        public String getTaxRate() {
            return taxRate;
        }

        public void setTaxRate(String taxRate) {
            this.taxRate = taxRate;
        }

        public String getNumber() {
            return number;
        }

        public void setNumber(String number) {
            this.number = number;
        }

        public String getTradeName() {
            return tradeName;
        }

        public void setTradeName(String tradeName) {
            this.tradeName = tradeName;
        }

        public String getUnit() {
            return unit;
        }

        public void setUnit(String unit) {
            this.unit = unit;
        }

        public String getTypeNo() {
            return typeNo;
        }

        public void setTypeNo(String typeNo) {
            this.typeNo = typeNo;
        }

        public String getTaxAmt() {
            return taxAmt;
        }

        public void setTaxAmt(String taxAmt) {
            this.taxAmt = taxAmt;
        }
    }



    /**
     * 购买方、销售方基础信息
     */
    class CompanyInfo{
        /**
         * 购买方地址、联系电话
         */
        private String addressPhone;
        /**
         * 购买方名称
         */
        private String name;

        /**
         * 购买方税号
         */
        private String taxNo;

        /**
         * 购买方银行账号、开户行信息
         */
        private String account;

        public String getAddressPhone() {
            return addressPhone;
        }

        public void setAddressPhone(String addressPhone) {
            this.addressPhone = addressPhone;
        }

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }

        public String getTaxNo() {
            return taxNo;
        }

        public void setTaxNo(String taxNo) {
            this.taxNo = taxNo;
        }

        public String getAccount() {
            return account;
        }

        public void setAccount(String account) {
            this.account = account;
        }
    }
}
